package com.wrox.begspring.pix.aspects;

import org.apache.log4j.Logger;
import org.apache.log4j.chainsaw.Main;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;

@Aspect
public class LoggingAspect {

    static Logger log = Logger.getLogger(Main.class.getName());

    @Before("execution(* com.wrox.begspring.pix.*(..))")
    public void logMethodExecution(JoinPoint jp) {
        log.warn(this);


//        System.out.println("AOP logging -> "
//                + jp.toShortString());
    }
}
